//
//var noSleep ;
//$(function(){
//	noSleep = new NoSleep();
////	disableNoSleep();
//	noSleep.enable();
//	alert("nosleep 运行了...");
//});
////能锁屏
//function enableNoSleep() {
//  noSleep.enable();
//  document.removeEventListener('touchstart', enableNoSleep, false);
//}
//// 不能锁屏
//function disableNoSleep() {
//	document.addEventListener('touchstart', enableNoSleep, false);
//	noSleep.disable();
//	alert("nosleep nengxingma");
//}
// 

var noSleep = new NoSleep();
 
function enableNoSleep() {
  noSleep.disable();
  document.removeEventListener('touchstart', enableNoSleep, false);
}
 
// Enable wake lock.
// (must be wrapped in a user input event handler e.g. a mouse or touch handler)
document.addEventListener('touchstart', enableNoSleep, false);
 
// ...
 
// Disable wake lock at some point in the future.
// (does not need to be wrapped in any user input event handler)
noSleep.enable();